package system

import (
	"github.com/gin-gonic/gin"
	"liuche17.cn/go-blog/server/middleware"
)

type SysArticleRouter struct{}

// InitSysArticleRouter 后台文章管理路由初始化
func (s *SysArticleRouter) InitSysArticleRouter(Router *gin.Engine) {
	sysArticleRouter := Router.Group("/admin/article").Use(middleware.JWTAuth())
	{
		sysArticleRouter.POST("/publish", sysArticleApi.PublishArticle)
		sysArticleRouter.DELETE("/delete/:id", sysArticleApi.DelArticle)
		sysArticleRouter.POST("/query/page", sysArticleApi.QueryByPage)
		sysArticleRouter.GET("/detail/:id", sysArticleApi.QueryDetail)
		sysArticleRouter.POST("/update", sysArticleApi.UpdateArticle)
		sysArticleRouter.GET("set/top/:id", sysArticleApi.SetTop)
		sysArticleRouter.GET("unset/top/:id", sysArticleApi.UnSetTop)
	}
}
